#include					"ApiSound.h"

ApiSound::ApiSound(SoundManager & controller) : _controller(controller)
{
	connect(&controller, SIGNAL(_readBufferFull(ISoundPacket *)), this, SLOT(readBufferFull(ISoundPacket *)));
}

ApiSound::~ApiSound()
{

}

void						ApiSound::play(ISoundPacket *pack, unsigned int stamp)
{
	_controller.play(pack, stamp);
}

void						ApiSound::takeOrder(IOrder *order)
{
	_controller.takeOrder(order);
}

void						ApiSound::readBufferFull(ISoundPacket *packet)
{
	emit _inputReady(packet);
}

ISoundPacket				*ApiSound::decode(IEncodedSoundPacket *enc)
{
	return _controller.decode(enc);
}

IEncodedSoundPacket			*ApiSound::encode(ISoundPacket *packet)
{
	return _controller.encode(packet);
}

void						ApiSound::decode(IEncodedSoundPacket *enc, ISoundPacket *packet)
{
	_controller.decode(enc, packet);
}

void						ApiSound::encode(ISoundPacket *packet, IEncodedSoundPacket *enc)
{
	_controller.encode(packet, enc);
}

IEncodedSoundPacket			*ApiSound::getIEncodedSoundPacket()
{
	return new EncodedSoundPacket();
}

void						ApiSound::setInput(bool state)
{
	_controller.setInput(state);
}

void						ApiSound::setOutput(bool state)
{
	_controller.setOutput(state);
}